#ifndef  _BIT_EDGE_HPP
#define  _BIT_EDGE_HPP


#include "predef.h"

 


#define SetBOld(n)					 stsoftcon.cSysBitBuff[n].bPrev = 1; 
#define ClrBOld(n)					 stsoftcon.cSysBitBuff[n].bPrev = 0; 
#define cGetBOld(n)					( stsoftcon.cSysBitBuff[n].bPrev )
#define cparToBOld(n,y)			{ if ( y )   {SetBOld(n);} else {ClrBOld(n); }}

#define SetB(n)					stsoftcon.cSysBitBuff[n].bCurr  = 1; 
#define ClrB(n)					stsoftcon.cSysBitBuff[n].bCurr = 0; 
#define cGetB(n)				( stsoftcon.cSysBitBuff[n].bCurr  )
#define IsUpB(n)				(( stsoftcon.cSysBitBuff[n].bCurr  ) && (!( stsoftcon.cSysBitBuff[n].bPrev  )))
#define IsDownB(n)		 	(( stsoftcon.cSysBitBuff[n].bPrev ) && (!( stsoftcon.cSysBitBuff[n].bCurr  )))
#define IsChangeB(n)  	(( stsoftcon.cSysBitBuff[n].bPrev ) != (( stsoftcon.cSysBitBuff[n].bCurr )))
//#define cparToB(n,y)		{ if ( y )   {SetB(n);} else { ClrB(n);} }
#define cparToB(n,y)		{  stsoftcon.cSysBitBuff[n].bCurr  = (_Bool)(y);}
#define  NotB(n)  			{ stsoftcon.cSysBitBuff[n].bCurr = !stsoftcon.cSysBitBuff[n].bCurr;}
void stBedge(void);
#endif
